/**
 * @param {number[]} nums
 * @return {number[]}
 */
var distinctDifferenceArray = function (nums) {
  let arr = []
  for (let i = 0; i < nums.length + 1; i++) {
    arr[i] = new Set(nums.slice(0, i + 1)) - new Set(nums.slice(i + 1))
  }

  return arr.slice(0, arr.length)
};

let set = new Set([1, 1, 1, 2, 3])

console.log(set);